home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / fs / write.c.D < prev   
Text File  |  1990-07-25  |  5KB  |  162 lines

  1. *** /tmp/,RCSt1022271    Wed Jul 25 13:49:13 1990
  2. --- write.c    Mon Jul 23 11:34:29 1990
  3. ***************
  4. *** 9,24 ****
  5.    */
  6.   
  7. ! #include "../h/const.h"
  8. ! #include "../h/type.h"
  9. ! #include "../h/error.h"
  10. ! #include "const.h"
  11. ! #include "type.h"
  12.   #include "buf.h"
  13.   #include "file.h"
  14.   #include "fproc.h"
  15. - #include "glo.h"
  16.   #include "inode.h"
  17.   #include "super.h"
  18.   
  19.   /*===========================================================================*
  20.    *                do_write                     *
  21. --- 9,21 ----
  22.    */
  23.   
  24. ! #include "fs.h"
  25.   #include "buf.h"
  26.   #include "file.h"
  27.   #include "fproc.h"
  28.   #include "inode.h"
  29.   #include "super.h"
  30.   
  31. + FORWARD int write_map();
  32.   /*===========================================================================*
  33.    *                do_write                     *
  34. ***************
  35. *** 36,40 ****
  36.   PRIVATE int write_map(rip, position, new_zone)
  37.   register struct inode *rip;    /* pointer to inode to be changed */
  38. ! file_pos position;        /* file address to be mapped */
  39.   zone_nr new_zone;        /* zone # to be inserted */
  40.   {
  41. --- 33,37 ----
  42.   PRIVATE int write_map(rip, position, new_zone)
  43.   register struct inode *rip;    /* pointer to inode to be changed */
  44. ! off_t position;            /* file address to be mapped */
  45.   zone_nr new_zone;        /* zone # to be inserted */
  46.   {
  47. ***************
  48. *** 48,55 ****
  49.     int new_ind, new_dbl;
  50.   
  51. -   extern zone_nr alloc_zone();
  52. -   extern struct buf *get_block();
  53. -   extern real_time clock_time();
  54.     rip->i_dirt = DIRTY;        /* inode will be changed */
  55.     bp = NIL_BUF;
  56. --- 45,48 ----
  57. ***************
  58. *** 59,64 ****
  59.     /* Is 'position' to be found in the inode itself? */
  60.     if (zone < NR_DZONE_NUM) {
  61. !     rip->i_zone[zone] = new_zone;
  62. !     rip->i_modtime = clock_time();
  63.       return(OK);
  64.     }
  65. --- 52,57 ----
  66.     /* Is 'position' to be found in the inode itself? */
  67.     if (zone < NR_DZONE_NUM) {
  68. !     rip->i_zone[(int) zone] = new_zone;
  69. !     rip->i_update = MTIME;    /* mark mtime for update later */
  70.       return(OK);
  71.     }
  72. ***************
  73. *** 110,115 ****
  74.     bp = get_block(rip->i_dev, b, (new_ind ? NO_READ : NORMAL) );
  75.     if (new_ind) zero_block(bp);
  76. !   bp->b_ind[excess] = new_zone;
  77. !   rip->i_modtime = clock_time();
  78.     bp->b_dirt = DIRTY;
  79.     put_block(bp, INDIRECT_BLOCK);
  80. --- 103,108 ----
  81.     bp = get_block(rip->i_dev, b, (new_ind ? NO_READ : NORMAL) );
  82.     if (new_ind) zero_block(bp);
  83. !   bp->b_ind[(int) excess] = new_zone;
  84. !   rip->i_update = MTIME;        /* mark mtime for update later */
  85.     bp->b_dirt = DIRTY;
  86.     put_block(bp, INDIRECT_BLOCK);
  87. ***************
  88. *** 121,127 ****
  89.    *                clear_zone                     *
  90.    *===========================================================================*/
  91. ! PUBLIC clear_zone(rip, pos, flag)
  92.   register struct inode *rip;    /* inode to clear */
  93. ! file_pos pos;            /* points to block to clear */
  94.   int flag;            /* 0 if called by read_write, 1 by new_block */
  95.   {
  96. --- 114,120 ----
  97.    *                clear_zone                     *
  98.    *===========================================================================*/
  99. ! PUBLIC void clear_zone(rip, pos, flag)
  100.   register struct inode *rip;    /* inode to clear */
  101. ! off_t pos;            /* points to block to clear */
  102.   int flag;            /* 0 if called by read_write, 1 by new_block */
  103.   {
  104. ***************
  105. *** 133,141 ****
  106.     register struct buf *bp;
  107.     register block_nr b, blo, bhi;
  108. !   register file_pos next;
  109.     register int scale;
  110.     register zone_type zone_size;
  111. -   extern struct buf *get_block();
  112. -   extern block_nr read_map();
  113.   
  114.     /* If the block size and zone size are the same, clear_zone() not needed. */
  115. --- 126,132 ----
  116.     register struct buf *bp;
  117.     register block_nr b, blo, bhi;
  118. !   register off_t next;
  119.     register int scale;
  120.     register zone_type zone_size;
  121.   
  122.     /* If the block size and zone size are the same, clear_zone() not needed. */
  123. ***************
  124. *** 166,170 ****
  125.   PUBLIC struct buf *new_block(rip, position)
  126.   register struct inode *rip;    /* pointer to inode */
  127. ! file_pos position;        /* file pointer */
  128.   {
  129.   /* Acquire a new block and return a pointer to it.  Doing so may require
  130. --- 157,161 ----
  131.   PUBLIC struct buf *new_block(rip, position)
  132.   register struct inode *rip;    /* pointer to inode */
  133. ! off_t position;            /* file pointer */
  134.   {
  135.   /* Acquire a new block and return a pointer to it.  Doing so may require
  136. ***************
  137. *** 179,186 ****
  138.     int scale, r;
  139.     struct super_block *sp;
  140. -   extern struct buf *get_block();
  141. -   extern struct super_block *get_super();
  142. -   extern block_nr read_map();
  143. -   extern zone_nr alloc_zone();
  144.   
  145.     /* Is another block available in the current zone? */
  146. --- 170,173 ----
  147. ***************
  148. *** 217,221 ****
  149.    *                zero_block                     *
  150.    *===========================================================================*/
  151. ! PUBLIC zero_block(bp)
  152.   register struct buf *bp;    /* pointer to buffer to zero */
  153.   {
  154. --- 204,208 ----
  155.    *                zero_block                     *
  156.    *===========================================================================*/
  157. ! PUBLIC void zero_block(bp)
  158.   register struct buf *bp;    /* pointer to buffer to zero */
  159.   {
  160.